package cn.bbstone.test;

import cn.bbstone.cache.local.LocalCacheUtil;

import java.util.Map;


public class BizDemoCacheUtil {

    private static final String DEMO_CACHE = "DEMO_CACHE";

    private static final LocalCacheUtil<String> localCacheUtil = new LocalCacheUtil<>();


    public static void loadCache(Map<String, String> cacheItems) {
        localCacheUtil.load(DEMO_CACHE, cacheItems);
    }
    public static String get(String code) {
        String name = localCacheUtil.get(DEMO_CACHE, code);
        if (name == null) {
            System.out.println("not found name for code");
            return code;
        }
        return name;
    }

    public void put(Map<String, String> cacheItems) {
        localCacheUtil.put(DEMO_CACHE, cacheItems);
    }

    public void put(String key, String value) {
        localCacheUtil.put(DEMO_CACHE, key, value);
    }


}
